package com.itheima.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.bean.OrderDetail;
import com.itheima.bean.Orders;
import com.itheima.common.pageParm;
import com.itheima.dao.OrderdetailDao;
import com.itheima.service.OrderdetailService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class OrderdetailServiceImpl implements OrderdetailService {

    @Resource
    private OrderdetailDao orderdetailDao;

    @Override
    public List<OrderDetail> findByOrderId(Long id) {

        LambdaQueryWrapper<OrderDetail> lqw = new LambdaQueryWrapper<>();

        lqw.eq(OrderDetail::getOrderId,id);

        return orderdetailDao.selectList(lqw);

    }
}
